//
//  NavCell.m
//  WanCaiC8
//
//  Created by tangang on 2018/5/14.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "NavCell.h"

@implementation NavCell{
    UIImageView *imageV;
    QXLable     *labTitle;
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        imageV=[[UIImageView alloc]init];
        [self.contentView addSubview:imageV];
        [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(self).with.offset(10);
            make.size.mas_equalTo(CGSizeMake(30, 30));
        }];
        
        labTitle=[[QXLable alloc]init];
        [self.contentView addSubview:labTitle];
        [labTitle mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(imageV.mas_right).with.offset(10);
        }];
        
        UIView *line=[[UIView alloc]init];
        line.backgroundColor=DEFAULTBGCOLOR;
        [self.contentView addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self);
            make.height.mas_equalTo(@.7);
        }];
    }
    return self;
}

- (void)setImage:(UIImage *)image andTitle:(NSString *)title{
    imageV.image=image;
    labTitle.text=title;
}

@end
